<div class="row m-n">
    <div class="crumbs-bar">
        <div yb-crumbs></div>
    </div>
    <div tabset type="tab">
        <div tab heading="销售统计报表">

            <div class="row wrapper-y-sm">
                <div class="search-bar wrapper-none col-xs-12">
                    <div class="btn-group m-l-xs pull-right">
                        <button type="button" class="btn btn-default base-color" ng-click="search()" title="刷新">
                            <i class="yb-icon ico-refresh"></i>
                        </button>
                        <button type="button" class="btn btn-default base-color" title="配置表格列"
                                ng-click="switchToolbar('ColConfig');">
                            <i class="yb-icon ico-set"></i>
                        </button>
                        <div class="btn btn-default base-color" >
                            <div title="导出" yb-download download-url="exportParam.allUrl" download-param="condition"
                                 download-duration="3">
                                <i class="yb-icon ico-export-o"></i>
                            </div>
                        </div>
                    </div>
                    <button class="btn-advance pull-right m-l-xs" ng-click="switchToolbar('AdvanceSearch')">高级搜索
                    </button>
                    <div class="input-group pull-right clearfix">
                        <input type="text" class="form-control txt-search" placeholder="采购申请单"
                               ng-model="condition.billNo">
                        <span class="input-group-addon cursor-pointer" ng-click="search(1)">搜索</span>
                    </div>
                </div>
                <div yb-advance-search show-toolbar="toolbarConfig.showAdvanceSearch" search-data="search(1)"
                     reset-data="reset()">
                    <div class="advance-search m-t-sm">
                        <div class="form-group clearfix">
                            <label class="control-label">采购申请单：</label>
                            <input type="text" name="billNo" ng-model="condition.billNo" class="form-control">
                        </div>
                        <div class="form-group clearfix">
                            <label class="control-label">客户：</label>
                            <input type="text" name="purchaseOrgNameLike" ng-model="condition.purchaseOrgNameLike" class="form-control">
                        </div>

                        <div class="form-group clearfix m-b-none">
                            <label class="control-label">下发时间：</label>
                            <input type="text" class="form-control date-picker" ng-model="condition.submitDateStart"
                                   datepicker-popup="{{'yyyy-MM-dd'}}" ng-click="switchDatePicker(0)"
                                   is-open="datePickerFlag[0]" close-text="关闭"
                                   ng-change="checkDate(condition, 'submitDateStart', 'submitDateEnd')"
                                   modal-size="small" readonly>
                        </div>
                        <div class="form-group clearfix m-b-none">
                            <label class="control-label"></label>
                            <label class="control-label wave-line">~</label>
                        </div>
                        <div class="form-group clearfix">
                            <label class="control-label"></label>
                            <input type="text" class="form-control date-picker" ng-model="condition.submitDateEnd"
                                   datepicker-popup="{{'yyyy-MM-dd'}}" ng-click="switchDatePicker(1)"
                                   is-open="datePickerFlag[1]" close-text="关闭"
                                   ng-change="checkDate(condition, 'submitDateStart', 'submitDateEnd')"
                                   modal-size="small" readonly>
                        </div>
                    </div>
                </div>
            </div>
            <div yb-col-config show-toolbar="toolbarConfig.showColConfig" ng-model="tbConf" col-fixed="false"
                 hide-sort-column="true"
                 has-check-col="true"></div>
            <div class="main-area d-b-60">

                <div yb-table-fixed class="table-fixed-wrap">
                    <div class="th-scroll-x"
                         ng-style="{'height':(tbConf.tableCol[9].isShow||tbConf.tableCol[10].isShow?82:48)+'px'} ">
                        <table class="table-fixed border-none" width="{{tbConf.scrollWidth}}">

                            <thead>
                            <tr>
                                <th width="150" rowspan="{{tbConf.tableCol[9].isShow||tbConf.tableCol[10].isShow?2:1}}"
                                    class="text-center th-check" ng-if="tbConf.tableCol[0].isShow">序号
                                </th>
                                <th width="200" rowspan="{{tbConf.tableCol[9].isShow||tbConf.tableCol[10].isShow?2:1}}"
                                    class="text-center th-check"
                                    ng-if="tbConf.tableCol[1].isShow">月份
                                </th>
                                <th width="200" rowspan="{{tbConf.tableCol[9].isShow||tbConf.tableCol[10].isShow?2:1}}"
                                    class="text-center th-check"
                                    ng-if="tbConf.tableCol[2].isShow">收货人
                                </th>
                                <th width="200" rowspan="{{tbConf.tableCol[9].isShow||tbConf.tableCol[10].isShow?2:1}}"
                                    class="text-center th-check"
                                    ng-if="tbConf.tableCol[3].isShow">采购单号
                                </th>
                                <th width="200" rowspan="{{tbConf.tableCol[9].isShow||tbConf.tableCol[10].isShow?2:1}}"
                                    class="text-center th-check"
                                    ng-if="tbConf.tableCol[4].isShow">客户名称
                                </th>
                                <th width="200" rowspan="{{tbConf.tableCol[9].isShow||tbConf.tableCol[10].isShow?2:1}}"
                                    class="text-center th-check"
                                    ng-if="tbConf.tableCol[5].isShow">采购单下发时间
                                </th>
                                <th width="200" rowspan="{{tbConf.tableCol[9].isShow||tbConf.tableCol[10].isShow?2:1}}"
                                    class="text-center th-check"
                                    ng-if="tbConf.tableCol[6].isShow">发货通知下发时间
                                </th>
                                <th width="200" rowspan="{{tbConf.tableCol[9].isShow||tbConf.tableCol[10].isShow?2:1}}"
                                    class="text-center th-check"
                                    ng-if="tbConf.tableCol[7].isShow">发运状态
                                </th>
                                <th width="200" rowspan="{{tbConf.tableCol[9].isShow||tbConf.tableCol[10].isShow?2:1}}"
                                    class="text-center th-check"
                                    ng-if="tbConf.tableCol[8].isShow">预计完成时间
                                </th>

                                <th class="text-center th-check" width="600" colspan="4"
                                    ng-if="tbConf.tableCol[9].isShow">种类
                                </th>
                                <th class="text-center th-check" width="600" colspan="4"
                                    ng-if="tbConf.tableCol[10].isShow">数量
                                </th>
                                <th class="text-center th-check" width="200"
                                    rowspan="{{tbConf.tableCol[9].isShow||tbConf.tableCol[10].isShow?2:1}}"
                                    ng-if="tbConf.tableCol[11].isShow">实际发运时间
                                </th>
                                <th class="text-center th-check" width="200"
                                    rowspan="{{tbConf.tableCol[9].isShow||tbConf.tableCol[10].isShow?2:1}}"
                                    ng-if="tbConf.tableCol[12].isShow">预计到达时间
                                </th>
                                <th class="text-center th-check" width="200"
                                    rowspan="{{tbConf.tableCol[9].isShow||tbConf.tableCol[10].isShow?2:1}}"
                                    ng-if="tbConf.tableCol[13].isShow">物流单号
                                </th>
                            </tr>
                            <tr ng-if="tbConf.tableCol[9].isShow||tbConf.tableCol[10].isShow">
                                <th class="text-center th-check border-top" width="150"
                                    ng-if="tbConf.tableCol[9].isShow">计划
                                </th>
                                <th class="text-center th-check border-top" width="150"
                                    ng-if="tbConf.tableCol[9].isShow">6001库库存
                                </th>
                                <th class="text-center th-check border-top" width="150"
                                    ng-if="tbConf.tableCol[9].isShow">已发
                                </th>
                                <th class="text-center th-check border-top" width="150"
                                    ng-if="tbConf.tableCol[9].isShow">完成率
                                </th>
                                <th class="text-center th-check border-top" width="150"
                                    ng-if="tbConf.tableCol[10].isShow">计划
                                </th>
                                <th class="text-center th-check border-top" width="150"
                                    ng-if="tbConf.tableCol[10].isShow">6001库库存
                                </th>
                                <th class="text-center th-check border-top" width="150"
                                    ng-if="tbConf.tableCol[10].isShow">已发
                                </th>
                                <th class="text-center th-check border-top" width="150"
                                    ng-if="tbConf.tableCol[10].isShow">完成率
                                </th>
                            </tr>
                            </thead>

                        </table>
                    </div>

                    <div class="td-scroll" ng-show="dataList.length > 0"
                         ng-style="{'top':(tbConf.tableCol[9].isShow||tbConf.tableCol[10].isShow?82:48)+'px'} ">
                        <table class="table-fixed border-none" width="{{tbConf.scrollWidth}}">
                            <tbody>
                            <tr ng-repeat="item in dataList track by $index">
                                <td width="150" class="text-center spill-dots" title="{{$index+1}}"
                                    ng-if="tbConf.tableCol[0].isShow">
                                    <span>{{$index+1}}</span>
                                </td>
                                <td width="200" class="text-center spill-dots" title="{{item.applicationMonth}}"
                                    ng-if="tbConf.tableCol[1].isShow">
                                    <span>{{item.applicationMonth}}</span>
                                </td>
                                <td width="200" class="text-center spill-dots" title="{{item.receiverName}}"
                                    ng-if="tbConf.tableCol[2].isShow">
                                    <span>{{item.receiverName}}</span>
                                </td>
                                <td width="200" class="text-center spill-dots" title="{{item.billNo}}"
                                    ng-if="tbConf.tableCol[3].isShow">
                                    <span>{{item.billNo}}</span>
                                </td>
                                <td width="200" class="text-center spill-dots" title="{{item.purchaseOrgName}}"
                                    ng-if="tbConf.tableCol[4].isShow">
                                    <span>{{item.purchaseOrgName}}</span>
                                </td>
                                <td width="200" class="text-center spill-dots" title="{{item.createDateShow}}"
                                    ng-if="tbConf.tableCol[5].isShow">
                                    <span>{{item.createDateShow}}</span>
                                </td>
                                <td width="200" class="text-center spill-dots" title="{{item.noteCreateDateShow}}"
                                    ng-if="tbConf.tableCol[6].isShow">
                                    <span>{{item.noteCreateDateShow}}</span>
                                </td>
                                <td width="200" class="text-center spill-dots" title="{{item.deliveryStatus}}"
                                    ng-if="tbConf.tableCol[7].isShow">
                                    <span>{{item.deliveryStatus}}</span>
                                </td>
                                <td width="200" class="text-center spill-dots" title="{{item.deliveryDateShow}}"
                                    ng-if="tbConf.tableCol[8].isShow">
                                    <span>{{item.deliveryDateShow}}</span>
                                </td>

                                <td width="150" class="text-center spill-dots" title="{{item.materialTypePlan}}"
                                    ng-if="tbConf.tableCol[9].isShow">
                                    <span>{{item.materialTypePlan}}</span>
                                </td>
                                <td width="150" class="text-center spill-dots" title="{{item.materialTypeHaveStock}}"
                                    ng-if="tbConf.tableCol[9].isShow">
                                    <span>{{item.materialTypeHaveStock}}</span>
                                </td>
                                <td width="150" class="text-center spill-dots" title="{{item.materialTypeDeliveried}}"
                                    ng-if="tbConf.tableCol[9].isShow">
                                    <span>{{item.materialTypeDeliveried}}</span>
                                </td>
                                <td width="150" class="text-center spill-dots" title="{{item.materialTypeFinishRate}}"
                                    ng-if="tbConf.tableCol[9].isShow">
                                    <span>{{item.materialTypeFinishRate}}</span>
                                </td>
                                <td width="150" class="text-center spill-dots" title="{{item.materialPlanAmount}}"
                                    ng-if="tbConf.tableCol[10].isShow">
                                    <span>{{item.materialPlanAmount}}</span>
                                </td>
                                <td width="150" class="text-center spill-dots" title="{{item.materialStock}}"
                                    ng-if="tbConf.tableCol[10].isShow">
                                    <span>{{item.materialStock}}</span>
                                </td>
                                <td width="150" class="text-center spill-dots" title="{{item.materialDeliveriedAmount}}"
                                    ng-if="tbConf.tableCol[10].isShow">
                                    <span>{{item.materialDeliveriedAmount}}</span>
                                </td>
                                <td width="150" class="text-center spill-dots" title="{{item.materialAmountFinishRate}}"
                                    ng-if="tbConf.tableCol[10].isShow">
                                    <span>{{item.materialAmountFinishRate}}</span>
                                </td>
                                <td width="200" class="text-center spill-dots" title="{{item.receiptDeliveryTimeShow}}"
                                    ng-if="tbConf.tableCol[11].isShow">
                                    <span>{{item.receiptDeliveryTimeShow}}</span>
                                </td>
                                <td width="200" class="text-center spill-dots" title="{{item.receiptDeliveryDateShow}}"
                                    ng-if="tbConf.tableCol[12].isShow">
                                    <span>{{item.receiptDeliveryDateShow}}</span>
                                </td>
                                <td width="200" class="text-center spill-dots" title="{{item.freightNo}}"
                                    ng-if="tbConf.tableCol[13].isShow">
                                    <span>{{item.freightNo}}</span>
                                </td>
                            </tr>

                            </tbody>
                        </table>
                    </div>
                    <div class="no-data w-full text-center p-t" ng-show="dataList.length === 0" style="top:82px">
                        暂时没有数据
                    </div>
                </div>
            </div>
            <div class="bottom-area page-bar wrapper-y-sm clearfix">
                <div yb-page-info ng-model="pageInfo" yb-refresh="search()"></div>
            </div>
        </div>
    </div>
</div>
